package com.learn.event;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @Author:Mark
 * @Description:
 * @Date: Created on 11:15 2018-11-13
 * @Modify by:
 */
@Component
public class DemoPublisher {

  @Autowired
  private ApplicationContext applicationContext;

  public void publish(String msg){
    applicationContext.publishEvent(new DemoEvent(this,msg));
  }
}
